﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
		xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
		mc:Ignorable="d" 
		x:Class="ReporterControlLibrary.MessageBox"
		xmlns:system="clr-namespace:System;assembly=mscorlib" 
        xmlns:converters="clr-namespace:ReporterControlLibrary.Converters"
        Title="New Project"
        Width="460"
        MinHeight="10"
        MinWidth="300"
        ResizeMode="NoResize"
        ShowInTaskbar="False"
        WindowStartupLocation="CenterOwner" 
        Background="{x:Null}" 
        AllowsTransparency="True" 
        WindowStyle="None" Height="240"
        x:Name="MessageBoxWindow"
        xmlns:sys="clr-namespace:System;assembly=mscorlib">
	
    <Window.Resources>
    	<ResourceDictionary>    		
    		<converters:IconTypeToStringConverter x:Key="IconConverter" />
            <converters:ButtonToVisibilityConverter x:Key="ButtonVisibilityConverter" />
            
            <x:ArrayExtension x:Key="YesNoButtonStates" Type="sys:String">
                <sys:String>YesNo</sys:String>                
                <sys:String>YesNoCancel</sys:String>                
            </x:ArrayExtension>

            <x:ArrayExtension x:Key="CancelButtonStates" Type="sys:String">
                <sys:String>YesNoCancel</sys:String>
                <sys:String>OKCancel</sys:String>
            </x:ArrayExtension>

            <x:ArrayExtension x:Key="OKButtonStates" Type="sys:String">
                <sys:String>OK</sys:String>
                <sys:String>OKCancel</sys:String>
            </x:ArrayExtension>

        </ResourceDictionary>
    </Window.Resources>
    
    <Grid x:Name="LayoutRoot" d:DataContext="{d:DesignData /SampleData/MessageBoxModelSampleData.xaml}" >
		<Border x:Name="OuterPanel" Background="{DynamicResource TextBrush}" Style="{DynamicResource ApplicationOuterPanelBorderStyle}">
						<Border.Effect>
				<DropShadowEffect Opacity="0.6" ShadowDepth="3" BlurRadius="10" Direction="320"/>
			</Border.Effect>
			<Border x:Name="Panel" Background="{DynamicResource ApplicationPanelBackgroundBrush}" Style="{DynamicResource ApplicationPanelBorderStyle}">
				<Grid Margin="5">
                    <TextBlock x:Name="CaptionTextBlock" HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding Caption}" VerticalAlignment="Top" Foreground="{DynamicResource TextBrush}" FontSize="{DynamicResource FormLabelLargerFontSize}" d:LayoutOverrides="VerticalAlignment" Style="{DynamicResource FormLabelStyle}"/>
                    <Border Background="{DynamicResource ControlBackgroundLightOpaqueBrush}" BorderBrush="{DynamicResource ApplicationPanelBackgroundBrush}" Style="{DynamicResource ApplicationInnerPanelBorderStyle}" Margin="0,30,0,0" >
						<Grid >
							<Grid.RowDefinitions>
								<RowDefinition/>
								<RowDefinition Height="34"/>
							</Grid.RowDefinitions>                               
							<Grid Margin="10,0" VerticalAlignment="Center">
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="48"/>
									<ColumnDefinition/>
								</Grid.ColumnDefinitions>
								<Image x:Name="IconImage" Source="{Binding Image, Converter={StaticResource IconConverter}}" d:DataContext="{Binding}" Margin="0,0,1,0" />
								<TextBlock x:Name="MessageBoxTextTextBlock" Text="{Binding MessageBoxText}" Margin="9,0,0,0" Foreground="{DynamicResource FormLabelBrush}" VerticalAlignment="Center" Style="{DynamicResource FormLabelStyle}" FontSize="{DynamicResource FormLabelLargeFontSize}" TextWrapping="Wrap" Grid.Column="1" />
							</Grid>                               
							<StackPanel Orientation="Horizontal" VerticalAlignment="Top" Margin="0,0,5,0" d:LayoutOverrides="Width" Grid.Row="1" HorizontalAlignment="Right">
                                <Button x:Name="YesButton" Click="YesButton_Click" Visibility="{Binding Button, ConverterParameter={StaticResource YesNoButtonStates}, Converter={StaticResource ButtonVisibilityConverter}}" Content="Yes" Padding="5" Height="25" Width="50" Margin="0,0,5,0"/>
                                <Button x:Name="NoButton" Click="NoButton_Click" Visibility="{Binding Button, ConverterParameter={StaticResource YesNoButtonStates}, Converter={StaticResource ButtonVisibilityConverter}}" Content="No" Padding="5" Height="25" Width="50" Margin="0,0,5,0"/>                                
                                <Button x:Name="OKButton" Click="OKButton_Click" Visibility="{Binding Button, ConverterParameter={StaticResource OKButtonStates}, Converter={StaticResource ButtonVisibilityConverter}}" Content="OK" Padding="5" Height="25" Margin="0,0,5,0" Width="50"/>
                                <Button x:Name="CancelButton" Click="CancelButton_Click" Visibility="{Binding Button, ConverterParameter={StaticResource CancelButtonStates}, Converter={StaticResource ButtonVisibilityConverter}}" Content="Cancel" Padding="5" Height="25" Width="50"/>
                            </StackPanel>
                        </Grid>
					</Border>       
				</Grid>       
			</Border>       
		</Border>
	</Grid>
</Window>
